﻿using System.Collections.Generic;
using System.ServiceModel;

namespace RockBus.DataContracts
{
    [MessageContract(WrapperNamespace = StringConstants.RockBusNamespace)]
    public class RemoveReceivePortsRequest
    {
        private RemoveReceivePortsRequest()
        {
            this.ReceivePortIds = new List<string>();
        }

        private RemoveReceivePortsRequest(string publisherId)
            : this()
        {
            this.PublisherId = publisherId;
        }

        public RemoveReceivePortsRequest(string publisherId, string receivePortId)
            : this(publisherId)
        {
            this.ReceivePortIds.Add(receivePortId);
        }

        public RemoveReceivePortsRequest(string publisherId, IEnumerable<string> receivePortIds)
            : this(publisherId)
        {
            ((List<string>)this.ReceivePortIds).AddRange(receivePortIds);
        }

        [MessageBodyMember]
        public string PublisherId { get; private set; }

        [MessageBodyMember]
        public ICollection<string> ReceivePortIds { get; private set; }
    }
}